package com.sunlee.admin.api.module.job.task;

import com.sunlee.common.service.service.ThirdProductService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 测试定时任务
 * testTask为spring bean的名称
 *
 * @author sunlee
 */
@Component("testTask")
public class TestTask implements ITask {

    private final Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private ThirdProductService thirdProductService;

    /**
     * 比对数据库和本地zip文件差异
     * @param params   参数，多参数使用JSON数据
     */
    @Override
    public void run(String params) {
//        logger.debug("TestTask定时任务正在执行，参数为：{}", params);
//        String dir = "D:\\PPT\\zip\\";
//        List<String> fileList = FileUtil.findFileList(dir, null);
//
//        List<ThirdProduct> list = thirdProductService.list(new LambdaQueryWrapper<ThirdProduct>()
//                .select(ThirdProduct::getZipPath, ThirdProduct::getZipId));
//
//        List<String> dbList = list.stream().map(ThirdProduct::getZipPath).collect(Collectors.toList());
//
//        Map<String, String> map = new HashMap<>(12000);
//
//        dbList.forEach(item -> {
//            if (Objects.nonNull(map.put(item, ""))) {
//                System.out.println(item);
//            }
//        });


    }
}
